# coding:utf-8
import time

from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By

import setting

wd = webdriver.Chrome(setting.WEBDRIVERURI)
wd.implicitly_wait(10)

wd.get('https://www.csdn.net/')
try:
    WebDriverWait(wd,20,0.5).until(EC.presence_of_element_located((By.LINK_TEXT,u'首页')))
finally:
    print(wd.find_element_by_link_text('首页').get_attribute('href'))

wd.quit()


